#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <sys/types.h>
#include <string.h>

int fadisplay()
{
    printf("playing");
}


#define func(x) fa##x

int main()
{
//   func(display)();
   long long a = 0x0102030405060708;
   printf("%d\n", sizeof(a));
   char* c = (char*)&a;
   for (int i = 0; i < 8; ++i)
   {
       printf("0x%x ", c[i]);
   }
   printf("\n");
   char cc[8];
   memset(cc, 0x00, sizeof(cc));
   long long aa = a;
   for (int i = 7; i >= 0; --i) {
       cc[i] |= aa;
       aa >>= 8;
   }

   for (int i = 0; i < 8; ++i) {
       printf("0x%x ", cc[i]);
   }
   printf("\n");

   int high = (cc[0] << 24) | (cc[1] << 16) | (cc[2] << 8) | (cc[3]);
   int low = (cc[4] << 24) | (cc[5] << 16) | (cc[6] << 8) | (cc[7]);
   printf("high: 0x%x, low: 0x%x\n", high, low);

   long long res = 0;
   res |= high;
   res = res << 32 | low;
   printf("res: 0x%lx\n", res);
   return 0;
}
